<?php
/**
 * Unfuddle TicketAssociation Model
 * This model relates tickets to eachother.
 *
 * @package     Unfuddle
 * @subpackage  Data Models
 * @author      Luke Visinoni <luke.visinoni@gmail.com>
 * @copyright   (c) 2010 Luke Visinoni <luke.visinoni@gmail.com>
 * @version     $Id: TicketAssociation.php 29 2011-05-09 07:08:53Z luke.visinoni $
 */
class Unfuddle_Model_TicketAssociation extends Unfuddle_Model_Abstract {

    /**
     * Access list of ticket associations for a particular ticket
     */
    const URI_TICKET_ASSOCIATIONS = 'projects/{project_id}/tickets/{ticket_id}/ticket_associations';
    
    /**
     * Access a particular association by its id
     */
    const URI_TICKET_ASSOCIATION_BY_ID = 'projects/{project_id}/tickets/{ticket_id}/ticket_associations/{ticket_association_id}';
    
    /**
     * @var string Model name
     */
    protected $_name = 'ticket-association';
    
    /**
     * @var array Model fields
     */
    protected $_fields = array (
        'created-at' => array('type' => 'datetime', 'required' => false, 'read-only' => true),
        'id' => array('type' => 'integer', 'required' => false, 'read-only' => true),
        'relationship' => array('type' => 'set', 'required' => false, 'read-only' => false, 'set' => array('parent', 'duplicate', 'related')),
        'ticket1-id' => array('type' => 'integer', 'required' => false, 'read-only' => false),
        'ticket2-id' => array('type' => 'integer', 'required' => false, 'read-only' => false),
    );

}
